<template>
  <text
    class="iconfont"
    :class="[type + '-' + name]"
    :style="{
      'font-size': _size,
      'line-height': _size,
      width: _size,
      height: _size,
    }"
  ></text>
</template>

<script>
export default {
  computed: {
    _size() {
	//	return this.size;
      if (/^\d+rpx$/.test(this.size)) {
        return this.size.replace(/^(\d+)rpx/g, `calc($1 / 7.5 * 1vw)`);
      } else {
        return this.size;
      }
    },
  },
  props: {
    type: {
      type: String,
      default: "app",
    },
    name: {
      type: String,
    },
    size: {
      type: String,
      default: "16rpx",
    },
  },
};
</script>

<style scoped lang="scss">
.iconfont {
   dispaly:inline;
  font-size: 16rpx;

}
</style>
